package cn.com.hhrcw.mapper;

import cn.com.hhrcw.entity.OpInterviewHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 职位-面试 Mapper 接口
 * </p>
 *
 * @author jiangdong
 * @since 2020-10-29
 */
@Mapper
public interface OpInterviewHistoryMapper extends BaseMapper<OpInterviewHistory> {

    /**
     * calculateInterviewRate
     *
     * @param companyId
     * @return
     */
    BigDecimal calculateInterviewRate(@Param("companyId") String companyId);

    /**
     * getSoonInterview
     *
     * @return
     */
    @Select("SELECT * from op_interview_history WHERE time between   now() and date_add(now(),interval 60 MINUTE) and out_line_state = 1 and del_flag = 0")
    List<OpInterviewHistory> getSoonInterview();
}
